/*
** my_put_nbr.c for  in /home/gueux_g//Documents
**
** Made by gregory gueux
** Login   <gueux_g@epitech.net>
**
** Started on  Mon Oct 10 11:15:13 2011 gregory gueux
** Last update Tue Oct 30 17:01:47 2012 gueux-g
*/

void    my_put_nbr(int nb)
{
  int   neg;

  neg = 0;
  if (nb < 0)
    {
      my_putchar('-');
      if (nb == -2147483647)
        {
	  neg = 1;
          nb++;
        }
      nb = nb * -1;
    }
  if (nb >= 10)
    my_put_nbr(nb / 10);
  if (neg == 1)
    {
      neg = 0;
      my_putchar(nb % 10 + '1');
    }
  else
    my_putchar(nb % 10 + '0');
}
